/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package it.apuliait.model.impl;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import it.apuliait.model.DocumentoXml;

import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

/**
 * The cache model class for representing DocumentoXml in entity cache.
 *
 * @author Donatello
 * @see DocumentoXml
 * @generated
 */
public class DocumentoXmlCacheModel implements CacheModel<DocumentoXml>,
	Externalizable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(9);

		sb.append("{documentoXmlId=");
		sb.append(documentoXmlId);
		sb.append(", documentoIDFK=");
		sb.append(documentoIDFK);
		sb.append(", annoCreazione=");
		sb.append(annoCreazione);
		sb.append(", documentoXml=");
		sb.append(documentoXml);
		sb.append("}");

		return sb.toString();
	}

	@Override
	public DocumentoXml toEntityModel() {
		DocumentoXmlImpl documentoXmlImpl = new DocumentoXmlImpl();

		documentoXmlImpl.setDocumentoXmlId(documentoXmlId);
		documentoXmlImpl.setDocumentoIDFK(documentoIDFK);

		if (annoCreazione == null) {
			documentoXmlImpl.setAnnoCreazione(StringPool.BLANK);
		}
		else {
			documentoXmlImpl.setAnnoCreazione(annoCreazione);
		}

		if (documentoXml == null) {
			documentoXmlImpl.setDocumentoXml(StringPool.BLANK);
		}
		else {
			documentoXmlImpl.setDocumentoXml(documentoXml);
		}

		documentoXmlImpl.resetOriginalValues();

		return documentoXmlImpl;
	}

	@Override
	public void readExternal(ObjectInput objectInput) throws IOException {
		documentoXmlId = objectInput.readLong();
		documentoIDFK = objectInput.readLong();
		annoCreazione = objectInput.readUTF();
		documentoXml = objectInput.readUTF();
	}

	@Override
	public void writeExternal(ObjectOutput objectOutput)
		throws IOException {
		objectOutput.writeLong(documentoXmlId);
		objectOutput.writeLong(documentoIDFK);

		if (annoCreazione == null) {
			objectOutput.writeUTF(StringPool.BLANK);
		}
		else {
			objectOutput.writeUTF(annoCreazione);
		}

		if (documentoXml == null) {
			objectOutput.writeUTF(StringPool.BLANK);
		}
		else {
			objectOutput.writeUTF(documentoXml);
		}
	}

	public long documentoXmlId;
	public long documentoIDFK;
	public String annoCreazione;
	public String documentoXml;
}